<?php
defined('IN_TS') or die('Access Denied.');

switch($ts) {
	case "user":
		$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
		$url = SITE_URL.'index.php?app=tbshare&ac=admin&mg=report&ts=user&page=';
		$lstart = $page*1-1;
		
		$usercount = $new['tbshare']->findCount('tbshare_user',null,"");
		$users = $new['tbshare']->findAll('tbshare_user',null,"");
		
		$pageUrl = pagination($usercount, 1, $page, $url);
		
		include template("admin/userlist");
		break;
	case 'favor':
		$sql = "SELECT s.title,s.pic,s.shareurl,f.tbshareid,f.userid,f.username,f.addtime "
			. " FROM ".dbprefix . "tbshare s"
		    . " INNER JOIN ".dbprefix . "tbshare_favor f"
			. " ON s.tbshareid = f.tbshareid"
			. " ORDER BY f.favorid DESC"
			;
		$favors = $db->fetch_all_assoc($sql);
		include template("admin/favorlist");
		break;
	
}